class BankAccount:
    def __init__(self):
        self.balance = 0

    def deposit(self, amount):
        if amount > 0:
            self.balance += amount
            return True
        return False

    def withdraw(self, amount):
        if 0 < amount <= self.balance:
            self.balance -= amount
            return True
        return False

    def get_balance(self):
        return self.balance


def log_transaction(func):
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        account = args[0]
        if isinstance(account, BankAccount):
            if func.__name__ == 'deposit':
                action = "存款"
            elif func.__name__ == 'withdraw':
                action = "取款"
            else:
                action = "查询余额"
            log_message = f"{action}操作：{func.__name__}，操作后余额为{account.get_balance()}"
            print(log_message)
        return result
    return wrapper


BankAccount.deposit = log_transaction(BankAccount.deposit)
BankAccount.withdraw = log_transaction(BankAccount.withdraw)
BankAccount.get_balance = log_transaction(BankAccount.get_balance)

if __name__ == "__main__":
    account = BankAccount()
    account.deposit(1000)
    account.withdraw(500)
    account.get_balance()